class Student(UserMixin, db.Model):
    __tablename__ = "student"

    student_id = db.Column(db.Integer, primary_key=True, unique=True)
    password_hash = db.Column(db.String(128))
    student_name = db.Column(db.String(8))
    date_of_birth = db.Column(db.DateTime)
    social_security_number = db.Column(db.String(8))
    status = db.Column(db.String(8))
    graduation_date = db.Column(db.DateTime)
    department = db.Column(db.String(20))
    balance = db.Column(db.Float)
    takes = db.relationship("Takes", backref="student")
    bill = db.relationship("Bill", backref="user")
    inputbox = db.relationship("Inputbox", backref="user")

    def __init__(self, **kwargs):
        super(Student, self).__init__(**kwargs)

    @property
    def password(self):
        raise AttributeError('password is not a readable attribute')

    @password.setter
    def password(self, password):
        self.password_hash = generate_password_hash(password)

    def get_id(self):
        return self.student_id

    def get_name(self):
        return self.student_name

    def is_student(self):
        return True

    def is_professor(self):
        return False

    def is_registrar(self):
        return False

    def verify_password(self, password):
        return check_password_hash(self.password_hash, password)